<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
<title><?php echo ($site_title); ?></title>
<meta name="keywords" content="<?php echo ($site_keywords); ?>" />
<meta name="description" content="<?php echo ($site_description); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="361dream">
<link href="/ke361/Public/static/mzui/css/mzui.min.css" rel="stylesheet">
<link href="/ke361/Public/static/lobibox/css/lobibox.min.css" rel="stylesheet">
<link href="/ke361/Public/Home/Mobile/css/header.css" rel="stylesheet">
<link href="/ke361/Public/Home/Mobile/css/footer.css" rel="stylesheet">
<link href="/ke361/Public/Home/Mobile/css/common.css" rel="stylesheet">
<link href="/ke361/Public/Home/images/favicon.ico" rel="icon" type="image/x-icon" />


<!--[if lt IE 9]>
<script type="text/javascript" src="/ke361/Public/static/jquery-1.10.2.min.js"></script>

<![endif]-->
<!--[if gte IE 9]>
<!-->
<script type="text/javascript" src="/ke361/Public/static/jquery-2.0.3.min.js"></script>
<!--<![endif]-->

<script type="text/javascript" src="/ke361/Public/static/jquery.lazyload.min.js"></script>
<script type="text/javascript" src="/ke361/Public/static/lobibox/js/Lobibox.js"></script>
<script src="/ke361/Public/Home/js/common.js"></script>


   
</head>
<body>

	<header>
	<div id="header_logo" class="col-xs-9" style="text-align: center">
		<img src="/ke361/Public/Home/Mobile/images/<?php echo C('WEB_SITE_LOGO');?>"/>
	</div>
</header>
<!--<div class="navbar-search">-->
    <!--<form class="" role="search" action="<?php echo U('Search/index');?>" method="POST">-->
    	<!--<input type="text" name="keywords" id="keywords" class="" placeholder="请输入想找的宝贝...">-->
   		<!--<button type="submit" class="hidden submit glyphicon glyphicon-search"></button>-->
	<!--</form>-->
<!--</div>   -->



	

	 <link href="/ke361/Public/Home/Mobile/css/list.css" rel="stylesheet">
	 <link href="/ke361/Public/Home/Mobile/css/pointsmall.css" rel="stylesheet">
	 <div class="container">
		<div class="row">
			<div class="col-md-9">
				<ul class="nav nav-tabs">
				  <li role="presentation" class="<?php if(($sort) == "create_time"): ?>active<?php endif; ?>"><a href="<?php echo U('PointsMall/index',array('type'=>$type));?>">默认</a></li>
				  <li role="presentation" class="<?php if(($sort) == "volume"): ?>active<?php endif; ?>"><a href="<?php echo U('PointsMall/index',array('sort'=>'volume','type'=>$type));?>">销量</a></li>
				  <li role="presentation" class="<?php if(($sort) == "price"): ?>active<?php endif; ?>"><a href="<?php echo U('PointsMall/index',array('sort'=>'price','type'=>$type));?>">价格</a></li>
				  <li role="presentation" class="<?php if(($sort) == "hits"): ?>active<?php endif; ?>"><a href="<?php echo U('PointsMall/index',array('sort'=>'hits','type'=>$type));?>">浏览量</a></li>
				</ul>
			</div>
		</div>
	 	<div class="row">
	 		
	 			<div class="goods-list col-sm-12">
			        <ul class="list">
			        <?php if(is_array($goods)): $i = 0; $__LIST__ = $goods;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li class="list-unstyled">
			                <div class="item">
			                    <div class="goods-pic">
			                        <a target="_blank" class="pic-img" href="<?php echo U('/pointsmall/'.$vo['id']);?>">
			                            <img class="lazy img-responsive" src="<?php echo (get_image_url($vo["pic_url"])); ?>" alt="<?php echo ($vo["name"]); ?>" style="display: inline;">
			                        </a>
			                    </div>
			                    <h5 class="title">
			                        <a class="black" target="_blank" href="<?php echo U('/pointsmall/'.$vo['id']);?>"><?php echo ($vo["name"]); ?></a>
			                        <div style="display:none;" class="icon-all">
			                        </div>
			                    </h5>
			                     <div class="goods-price">
			                        <span class="price-current">
			                            <em>所需积分：</em><?php echo (ceil($vo['price'])); ?>
			                        </span>
			                        
			                    </div>
			                   
			                </div>
			            </li><?php endforeach; endif; else: echo "" ;endif; ?>
			           
			        </ul>  
				</div>
	 	
	 	</div>
	 	
	 	<?php if(!empty($_page)): ?><div class="row">
	        	<div class="col-sm-12 ">
					<button id="next" class="btn" p="2" total-page="<?php echo ($total_page); ?>">
						点击加载更多
					</button>
				</div>
	      </div><?php endif; ?>
      </div>	 

	
	
	
	<!-- 页脚 -->

	<div class="container" style="margin-top:48px;">

		<div class="row  bottom-menu" style="display: block;">
			<div class="index  item" align="center">
				<a href="<?php echo U('Index/index');?>">
					<i class="icon icon-home"></i>首页
				</a>
			</div>
			<div class=" item" align="center">
				<a href="<?php echo U('Goods/index');?>">
					<span class="icon icon-dollar"></span>商品
				</a>
			</div>
			<div class=" item" align="center">
				<a href="<?php echo U('Article/index');?>">
					<span class="icon icon-book"></span>攻略
				</a>
			</div>
			<div class=" item" align="center">
				<a href="<?php echo U('User/index');?>">
					<span class="icon icon-user"></span>我的
				</a>
			</div>
		</div>




	</div>



<div class="big-bg">
</div>
<!-- 信息提示框 -->
<div id="top-alert" class="fixed alert alert-error" style="display: none;">
    <button class="close fixed" style="margin-top: 4px;">&times;</button>
    <div class="alert-content">这是内容</div>
</div>
<div id="message" class="fixed message " style="display:none ;">
    <button class="close fixed" style="margin-top: 4px;">&times;</button>
    <div class="alert-content">这是内容</div>
</div>

<?php echo C('TONGJI');?>


	
<script>
    var haveData                    =   true;
	$(function(){
        $('.lazy').lazyload();
        $(window).scroll(function () {
            if ($(window).scrollTop() == $(document).height() - $(window).height()) {
                nextPage();
            }
        });
		$(".goods-list li").hover(
 				function(){
 				   //当鼠标放上去的时候,程序处理
 				   $(this).addClass("hover1 hover");
 				},
 				function(){
 				   //当鼠标离开的时候,程序处理
 				   $(this).removeClass("hover1 hover");
 				});
 		
 		$('.article-list').find('li').hover(
				function(){
					$(this).css('box-shadow','0px 2px 8px 3px #ccc');
				},
				function(){
					$(this).css('box-shadow','');
				}
			
		);
 		$('#header-search').click(function(){
 			var search = $('.navbar-search');
 			if(search.css('display')=='block'){
 				$('.big-bg').hide();
 	 			$('.navbar-search').hide();
 			}else{
 				$('.navbar-search').show();
 	 			$('.big-bg').show();
 			}
 			
 		});
 		$('.big-bg').click(function(){
 			$('.big-bg').hide();
 			$('.navbar-search').hide();
 		});
 		$('.glyphicon-heart').click(function(){
			 id = $(this).attr('data-id');
			 that = $(this);
			 $.get("<?php echo U('Article/favor');?>",{'id':id},function(json){
	            showMessage(json.info);
	            if(json.status == 1){
	            	that.css('color','red');	
	            }else{
	            	that.css('color','red');	
	            }
	  	  	});  
		});
 		$('.icon-like').click(function(){
			 id = $(this).attr('data-id');
			 that = $(this);
			 $.get("<?php echo U('Article/favor');?>",{'id':id},function(json){
	            showMessage(json.info);
	            if(json.status == 1){
	            	that.addClass('like');	
	            }else{
	            	that.removeClass('like');	
	            }
	  	  	});  
		});
		
	});

function favor(goodsid){
    $.get("<?php echo U('ajax/favor');?>",{id:goodsid},function(json){
            showMessage(json.info);
    })    
}    
function showMessage(msg){
    Lobibox.notify('error', {
        showClass: 'bounceIn',
        hideClass: 'bounceOut',
        msg: msg,
        soundPath: '/ke361/Public/static/lobibox/sounds/'
    });
    console.log(msg);
}
function heightlight_bottom_nav(url){
	
	$('.bottom-menu').find('a[href^="'+url+'"]').closest('div').addClass('active');  	
}
</script>

<script>
	$(function(){

			
		 $('#next').click(function(){
		  	LoadPage();  
		  });
	});
	function LoadPage(){
		
		var currentPage = $('#next').attr('p') ? $('#next').attr('p') : 1;
		$.get("<?php echo U('PointsMall/index');?>",{'p':currentPage},function(result){
			if(result.errno==0){
				$('.goods-list .list').append(result.content);
				$('#next').attr('p',result.p);
				if(result.p>=$('#next').attr('total-page')){
					$('#next').html('木有了，亲');
					$('#next').attr('disabled',true);
					$('#next').addClass('disabled');
				}
			}
			
		},'json');	
	}
	</script>






</body>
</html>